package com.yoso.vo;

import cn.hutool.core.util.SerializeUtil;
import com.yoso.core.util.BeanMapperUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

@Data
@Accessors(chain = true)
public class UserVo implements Serializable {

    @NotBlank(message = "用户编码不能为空")
    private String userCode;

    private UserVo son;


    public static void main(String[] args) {
        UserVo userVo = new UserVo();
        userVo.setUserCode("yypp");

        BeanMapperUtil.mapperFactory.classMap(userVo.getClass(), UserVo.class).byDefault().register();

        UserVo clone = BeanMapperUtil.mapperFactory.getMapperFacade().map(userVo, UserVo.class);
        System.out.println(clone);
    }
}
